package com.ruoyi.order.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.OrderEvaluateMapper;
import com.ruoyi.order.domain.OrderEvaluate;
import com.ruoyi.order.service.IOrderEvaluateService;

/**
 * 订单评价Service业务层处理
 * 
 * @author DEREK
 * @date 2023-06-28
 */
@Service
public class OrderEvaluateServiceImpl extends ServiceImpl<OrderEvaluateMapper, OrderEvaluate> implements IOrderEvaluateService 
{
    @Autowired
    private OrderEvaluateMapper orderEvaluateMapper;

    /**
     * 查询订单评价
     * 
     * @param id 订单评价主键
     * @return 订单评价
     */
    @Override
    public OrderEvaluate selectOrderEvaluateById(Long id)
    {
        return orderEvaluateMapper.selectOrderEvaluateById(id);
    }

    /**
     * 查询订单评价列表
     * 
     * @param orderEvaluate 订单评价
     * @return 订单评价
     */
    @Override
    public List<OrderEvaluate> selectOrderEvaluateList(OrderEvaluate orderEvaluate)
    {
        return orderEvaluateMapper.selectOrderEvaluateList(orderEvaluate);
    }

    /**
     * 新增订单评价
     * 
     * @param orderEvaluate 订单评价
     * @return 结果
     */
    @Override
    public int insertOrderEvaluate(OrderEvaluate orderEvaluate)
    {
        orderEvaluate.setCreateTime(DateUtils.getNowDate());
        return orderEvaluateMapper.insertOrderEvaluate(orderEvaluate);
    }

    /**
     * 修改订单评价
     * 
     * @param orderEvaluate 订单评价
     * @return 结果
     */
    @Override
    public int updateOrderEvaluate(OrderEvaluate orderEvaluate)
    {
        return orderEvaluateMapper.updateOrderEvaluate(orderEvaluate);
    }

    /**
     * 批量删除订单评价
     * 
     * @param ids 需要删除的订单评价主键
     * @return 结果
     */
    @Override
    public int deleteOrderEvaluateByIds(Long[] ids)
    {
        return orderEvaluateMapper.deleteOrderEvaluateByIds(ids);
    }

    /**
     * 删除订单评价信息
     * 
     * @param id 订单评价主键
     * @return 结果
     */
    @Override
    public int deleteOrderEvaluateById(Long id)
    {
        return orderEvaluateMapper.deleteOrderEvaluateById(id);
    }
}
